package com.heima.utils.thread;

import com.heima.model.wemedia.pojos.WmUser;

public class WmThreadLocal {
    private final static ThreadLocal<WmUser> wmUserThreadLocal = new ThreadLocal<>();

    /**
     * 添加用户
     * @param wmUser
     */
    public static void setUser(WmUser wmUser){
        wmUserThreadLocal.set(wmUser);
    }

    /**
     * 获取用户
     * @return
     */
    public static WmUser getUser(){
        return wmUserThreadLocal.get();
    }

    /**
     * 删除用户
     */
    public static void remove(){
        wmUserThreadLocal.remove();
    }
}
